<!DOCTYPE html>

<?php include "res/title.php"; ?>

<html>
<head>
	<title>GoDeal - <?php echo $title; ?></title>
	<meta charset="UTF-8">

	<link href='http://fonts.googleapis.com/css?family=Open+Sans&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
	<link rel="stylesheet" type="text/css" href="/css/style.css">
	<link rel="icon" type="image/png" href="/favicon.png" />

	<script type="text/javascript" src="/js/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="/js/client-script.js"></script>
</head>
<body>

	<!-- Navigation -->
	<?php include "res/navigation.php"; ?>

	<div class="wrapper">
		<!-- Categories -->
		<?php include "res/categories.php"; ?>

		<!-- Right content -->
		<?php include "res/right-content.php" ?>

		<div class="container">
			<h1>Мои счета</h1>

			<table cellspacing='0'>
				<thead>
					<td>Услуга</td>
					<td>Номер для оплаты</td>
					<td>Осталось к оплате</td>
					<td>Операции</td>
				</thead>

				<?php foreach ($bills as $bill) { ?>
				<?php if($bill->status == "payed" || $bill->status == "deleted") continue; ?>
				<tr>
					<td>
						<?php if($bill->cost == 0) { 
							echo "Пополнение личного счета";
						} else { ?>
							<?php echo $product[$bill->id][0]->name; ?>
						<?php } ?>
					</td>
					<td><?php echo $bill->id ?></td>
					<td>
						<?php if($bill->cost == 0) { 
							echo "Неограниченно";
						} else {
							echo $bill->cost."/".$product[$bill->id][0]->cost;
						} ?>
					</td>
					<td><a href="/godeal/home/deleteBill/<?php echo $bill->id ?>" class="button">Удалить</a></td>
				</tr>
				<?php } ?>
			</table>
		</div>

		<!-- Footer -->
		<?php include "res/footer.php"; ?>
	</div>

	<!-- Popup Login -->
	<?php include "res/popup-login.php" ?>
</body>
</html>